From e186db58d090619cea76cd63c0e0b20af6786365 Mon Sep 17 00:00:00 2001 From: "robertlipe@gmail.com" Date: Tue, 29 Nov 2011 16:59:35 +0000 Subject: [PATCH] Fix HAVE_LIBEXPAT test in autoconf for cross dev case. git-svn-id: http://gpsbabel.googlecode.com/svn/trunk@4126 f51c46e8-681c-474f-0cfe-069cfd0219fb --- gpsbabel/configure | 33 +++++++++------------------------ gpsbabel/configure.in | 11 ++++------- 2 files changed, 13 insertions(+), 31 deletions(-) diff --git a/gpsbabel/configure b/gpsbabel/configure index ec4f9e1c1..c0709eb97 100755 --- a/gpsbabel/configure +++ b/gpsbabel/configure @@ -4518,31 +4518,16 @@ else # libexpat installed via fink EXPAT_LIB=/sw/lib/libexpat.a LIBS="$LIBS -L/sw/lib" - -cat >>confdefs.h <<\_ACEOF -#define HAVE_LIBEXPAT 1 -_ACEOF - fi if test -f /opt/local/lib/libexpat.a ; then # libexpat installed via macports EXPAT_LIB=/opt/local/lib/libexpat.a LIBS="$LIBS -L/opt/local/lib" - -cat >>confdefs.h <<\_ACEOF -#define HAVE_LIBEXPAT 1 -_ACEOF - fi if test -f /usr/local/lib/libexpat.a ; then # libexpat installed from source EXPAT_LIB=/usr/local/lib/libexpat.a LIBS="$LIBS -L/usr/local/lib" - -cat >>confdefs.h <<\_ACEOF -#define HAVE_LIBEXPAT 1 -_ACEOF - fi ;; *-gentoo-freebsd*) @@ -4551,11 +4536,6 @@ _ACEOF *-*-freebsd*) if test -f /usr/local/lib/libexpat.a ; then EXPAT_LIB=/usr/local/lib/libexpat.a - -cat >>confdefs.h <<\_ACEOF -#define HAVE_LIBEXPAT 1 -_ACEOF - fi ;; esac @@ -4564,7 +4544,15 @@ _ACEOF fi -if test "x${EXPAT_LIB}" = x; then +if ! test "x${EXPAT_LIB}" = x; then + { echo "$as_me:$LINENO: result: $EXPAT_LIB" >&5 +echo "${ECHO_T}$EXPAT_LIB" >&6; } + +cat >>confdefs.h <<\_ACEOF +#define HAVE_LIBEXPAT 1 +_ACEOF + +else { echo "$as_me:$LINENO: result: try to autodetect" >&5 echo "${ECHO_T}try to autodetect" >&6; } { echo "$as_me:$LINENO: checking for XML_ParserCreate in -lexpat" >&5 @@ -4638,9 +4626,6 @@ _ACEOF fi -else - { echo "$as_me:$LINENO: result: $EXPAT_LIB" >&5 -echo "${ECHO_T}$EXPAT_LIB" >&6; } fi diff --git a/gpsbabel/configure.in b/gpsbabel/configure.in index 74a7c3ab2..719f8dd6b 100644 --- a/gpsbabel/configure.in +++ b/gpsbabel/configure.in @@ -303,19 +303,16 @@ AC_ARG_WITH(libexpat, # libexpat installed via fink EXPAT_LIB=/sw/lib/libexpat.a LIBS="$LIBS -L/sw/lib" - AC_DEFINE(HAVE_LIBEXPAT, 1, [Defined if you have libexpat]) fi if test -f /opt/local/lib/libexpat.a ; then # libexpat installed via macports EXPAT_LIB=/opt/local/lib/libexpat.a LIBS="$LIBS -L/opt/local/lib" - AC_DEFINE(HAVE_LIBEXPAT, 1, [Defined if you have libexpat]) fi if test -f /usr/local/lib/libexpat.a ; then # libexpat installed from source EXPAT_LIB=/usr/local/lib/libexpat.a LIBS="$LIBS -L/usr/local/lib" - AC_DEFINE(HAVE_LIBEXPAT, 1, [Defined if you have libexpat]) fi ;; *-gentoo-freebsd*) @@ -324,21 +321,21 @@ AC_ARG_WITH(libexpat, *-*-freebsd*) if test -f /usr/local/lib/libexpat.a ; then EXPAT_LIB=/usr/local/lib/libexpat.a - AC_DEFINE(HAVE_LIBEXPAT, 1, [Defined if you have libexpat]) fi ;; esac ] ) -if test "x${EXPAT_LIB}" = x; then +if ! test "x${EXPAT_LIB}" = x; then + AC_MSG_RESULT($EXPAT_LIB) + AC_DEFINE(HAVE_LIBEXPAT, 1, [Defined if you have libexpat]) +else AC_MSG_RESULT(try to autodetect) AC_CHECK_LIB([expat], [XML_ParserCreate], AC_DEFINE(HAVE_LIBEXPAT, 1, [Defined if you have libexpat]) EXPAT_LIB=-lexpat ) -else - AC_MSG_RESULT($EXPAT_LIB) fi AC_SUBST(EXPAT_LIB) -- 2.30.2